package teaching.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import teaching.interceptors.JwtInterceptor;

/**
 * Author:20201002983_郑雨蓓
 * Date: 2024/3/2
 * Description:配置放行重写
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Autowired
    private JwtInterceptor jwtInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //放行得接口路径如下
        registry.addInterceptor(jwtInterceptor).excludePathPatterns("/user/login", "/user/studentLogin","/user/register",
                "/course/download/{filename}");
    }
}
